<?php
App::uses('TWSFormHelper', 'View/Helper');

class TWSFormHelper extends FormHelper {
  public function input($fieldName, $options = array()) {
    return $this->wrapLabel(parent::input($fieldName, $options));
  }

  private function wrapLabel($output) {
    $retVal = $output;
    if(!empty($output)){
      if(strpos($output,"</label>")!==false){
        $retVal = str_replace('</label>', "", $output)."</label>";
      }
    }
    return $retVal;
  }
}

?>
